#pragma once
#include "../radar.h"
#include "common.h"
#include "../radar_data_manager.h"
#include "randomsignalemitter.h"
#include <iostream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <thread>
#include <vector>
#define	UNCOMPRESSED_PACKET_BUFFER_SIZE  16384		

class yuanzhou_decode : public Radar
{
public:
    yuanzhou_decode(boost::asio::io_service& io_service);
    virtual ~yuanzhou_decode();
    //flag
    int  size_512 = 1;
    int  uncompress_size;
public:
    virtual bool do_video_processer(const char *data, unsigned int length);
    virtual void do_status_processer(const char *data, unsigned int length, unsigned int radar_key = 0);

    virtual void StartOwnProcess();
    void SendCmd(const std::string &data);
    void Video_16to1(int spokeAzimuth, unsigned char *Data);
private:
    bool check_frame_head(unsigned char*);
    void OnRadarRangeChanged(unsigned int range);
    int uncompress_radar_data(const unsigned char *srcData, int srcSize, unsigned char *resultBuffer);
    void Video_Message(unsigned char *Data);
    //double GetBetween(const Cat240ItemHeader_t &spoke);
    double rangeChanged(int index);
private:
    unsigned char m_old_range;


};
